/** @format */

import axios from '@/utils/request';

// 获取菜单
export function getUserPermissionByToken(params) {
  return axios.get('/sys/permission/getUserPermissionByToken', {
    params: params,
  });
}

// 菜单树列表
export function list(params) {
  return axios.get('/sys/permission/list', {
    params: params,
  });
}

// 一级菜单下拉
export function getSystemMenuList() {
  return axios.get('/sys/permission/getSystemMenuList');
}

// 添加菜单
export function add(data) {
  return axios.post('/sys/permission/add', data, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

// 编辑菜单
export function update(data) {
  return axios.put('/sys/permission/edit', data);
}

// 菜单详情
export function getInfo(permissionId) {
  return axios.get('/sys/permission/queryById', { params: {permissionId: permissionId} });
}

// 数据字典 字典项删除
export function del(permissionId) {
  return axios.delete('/sys/permission/delete', { params: {permissionId: permissionId} });
}
